home *** CD-ROM | disk | FTP | other *** search
- Q32294 _Bios_keybrd() Incompatible with CTRL+BREAK Key Combination
- C Compiler
- 5.10 | 5.10
- MS-DOS | OS/2
-
- Summary:
-
- The example code below demonstrates a problem with the C run-time
- function _bios_keybrd and CTRL+BREAK key combination. The routine
- works properly until the CTRL+BREAK key combination is executed, at
- which time the system locks up and requires a soft reboot. A
- workaround comment is provided in the code.
-
- The following code demonstrates the problem:
-
- #include <bios.h>
- #include <stdio.h>
- #define kbpress() _bios_keybrd(_KEYBRD_READY)
- #define kbchar() _bios_keybrd(_KEYBRD_READ)
- main()
- {
- unsigned char cchr;
- printf("press any key:\n");
- cchr = ' ';
- do
- {
- if(kbpress())
- /* the insertion of <break;> here alleviates the problem*/
- {cchr = getchar()/*kbchar() & 0x00ff*/;
- printf("\nchar = %c\n",cchr);
- }
- }
- while (cchr!='*');
- }
-
-
- Keywords: buglist5.10
- Updated 88/09/27 04:30
-